AttachDisk
Description
Call the AttachDisk to mount a data disk or a system disk for an ECS instance. The instance and the cloud disk must be in the same zone.
Request Method
POST
Request Path
/apsara/route/Ecs/AttachDisk
Request Parameters Common Parameters
Name | Location | Type | Required | Sample value | Description |
---|---|---|---|---|---|
KeyPairName | BODY | string | No | test-KeyPairName | The name of the SSH key pair bound to the Linux system ECS instance when the system disk is mounted. Windows Server system: SSH key pair is not supported. Even if this parameter is filled in, only Password is executed. Linux system: the password login method will be initialized to be prohibited. |
InstanceId | BODY | string | Yes | i-bp1ahcvgu9z55pk7**** | ID of the target ECS instance. |
regionId | BODY | string | Yes | No sample value for this parameter. | region id |
Device | BODY | string | No | testName | cloud disk device name. Description This parameter is about to be deprecated. To improve compatibility, it is recommended that you use other parameters as much as possible. |
DeleteWithInstance | BODY | boolean | No | false | When an instance is released, whether the cloud disk is released with the instance. true: release. false: not released. default value: false. description set DeleteWithInstance to false, once the ECS instance is safely controlled, that is, OperationLocks marked "LockReason" : "security", when the ECS instance is released, this attribute of the cloud disk will be ignored and released at the same time. |
Bootable | BODY | boolean | No | false | whether it is mounted as a system disk. default value: false. description set to Bootable = true, the target ECS instance must be in a system disk-free state. |
version | BODY | string | No | 2016-01-01 | version of api |
DiskId | BODY | string | Yes | d-bp198f7xn673w2rw**** | cloud disk ID to be mounted. Cloud disk (DiskId) and instance (InstanceId) must be in the same zone. description supports mounting data disks and system disks. for related constraints, please refer to the interface description section above. |
Password | BODY | string | No | EcsV587! | When mounting the system disk, set the user name and password of the instance, which only takes effect for the administrator and root user names, but not for other user names. It is 8 to 30 characters in length and must contain both uppercase and lowercase letters, numbers, and special symbols. Special symbols can be: ()'~! @#$%^&*-_+=|{}[]:;'<> ;,?//code>/pre> p data-tag = "p" class = "p"> where the Windows instance cannot use the slash (/) as the first character of the password. description if you pass in Password parameter, it is recommended that you use HTTPS protocol to send requests to avoid password disclosure. |
Return data
Name | Type | Sample value | Description |
---|---|---|---|
RequestID | string | 1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC | Request id |
Example
Successful Response example
{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}
Failed Response example
{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}
}